from dotenv import load_dotenv
from os import getenv

load_dotenv()

# Configuration settings for the application
class Settings:
    PROJECT_NAME: str = getenv("PROJECT_NAME", "Password Manager")
    
    API_V1_STR: str = "/api/v1"
    
    # 安全配置
    JWT_SECRET_KEY: str = getenv("JWT_SECRET_KEY", "default_secret_key")
    ALGORITHM: str = getenv("ALGORITHM", "HS256")
    ACCESS_TOKEN_EXPIRE_MINUTES: int = int(getenv("ACCESS_TOKEN_EXPIRE_MINUTES", 60 * 24 * 7))
    
    # Database settings
    DATABASE_URL: str = getenv("DATABASE_URL", "sqlite:///./test.db")
    
    # 
    PORT: int = int(getenv("PORT", 8000))
    
    DEBUG: bool = bool(getenv("DEBUG", False))
    
    class Config:
        env_file = ".env"
        env_file_encoding = "utf-8"

settings = Settings()
